(function () {
    var core = ecui,
        util = core.util,
        dom = ecui.dom;
    ecui.esr.addRoute('perform', {
        model: [
            'detail@GET /erp-management/data-bank/h5/play/${id}'
        ],
        weight: 5,
        main: 'info_detail-perform',
        view: 'detail.perform',
        frame: true,
        CACHE: false,
        onbeforerequest: function (context) {
        },
        onbeforerender: function (context) {
            context.price = ' -- ';
            var price = [], minprice, maxprice;
            if (context.detail && context.detail.playTicket) {
                context.detail.playTicket.forEach(function (item) {
                    price.push(item.price);
                });
            }
            minprice = Math.min.apply(null, price);
            maxprice = Math.max.apply(null, price);
            if (minprice === maxprice) {
                context.price = ' ' + minprice;
            } else {
                context.price = ' ' + minprice + ' - ' + maxprice;
            }
        },
        onafterrender: function (context) {
        }
    });
}());